package com.liuhung.ash.fang.foreController;

import com.liuhung.ash.fang.entity.*;
import com.liuhung.ash.fang.page.*;
import com.liuhung.ash.fang.service.*;
import com.liuhung.base.web.BaseAction;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <b>项目Controller</b>
 * <b>ProjectController<br>
 */ 
@Controller
@RequestMapping("/f/huxing")
public class ForeHuxingController extends BaseAction{
	
	private final static Logger log= Logger.getLogger(ForeHuxingController.class);
	// Servrice start
	@Autowired(required=false) //自动注入，不需要生成set方法了，required=false表示没有实现类，也不会报错。
	private ProjectService projectService;

	@Autowired(required=false) //自动注入，不需要生成set方法了，required=false表示没有实现类，也不会报错。
	private HuxingService huxingService;



	@RequestMapping("/{id}")
	public ModelAndView  rexiao(@PathVariable Integer id,HttpServletRequest request) throws Exception{
		Map<String,Object> context = new HashMap<String,Object>();
		Huxing huxing = huxingService.queryById(id);
		if (huxing ==null){
			throw new NoSuchRequestHandlingMethodException(request);
		}
		context.put("huxing", huxing);

		return forword("huxing",context);
	}
}
